package com.zhangwei.zklx1015.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhangwei.zklx1015.entity.Apply;
import com.zhangwei.zklx1015.entity.ApplyVo;
import com.zhangwei.zklx1015.mapper.ApplyMapper;
import com.zhangwei.zklx1015.service.IApplyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhangwei
 * @since 2021-10-15
 */
@Service
public class ApplyServiceImpl extends ServiceImpl<ApplyMapper, Apply> implements IApplyService {

    @Autowired
    private ApplyMapper applyMapper;


    @Override
    public PageInfo getlist(ApplyVo vo, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Apply> list = this.baseMapper.list(vo);

        //List<Apply> list = applyMapper.list(vo);
        PageInfo<Apply> info = new PageInfo<>(list);
        return info;
    }

    @Override
    public Apply selectApplyById(Integer id) {
        return applyMapper.selectApplyById(id);
    }
}
